/**
 * webpack真正执行完成后回调的插件
 */

class BuildFinishPlugin {
	constructor(options) {
		this.options = options
	}

	apply(compiler) {
		const { callback } = this.options;
		compiler.hooks.afterDone.tap("BuildFinishPlugin", (stats) => {
			process.nextTick(() => {
				if(callback){
					callback()
				}
			})
		})
	}
}

module.exports = BuildFinishPlugin
